home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Tool Chest / Development Platforms / Macintosh Common Lisp Related / interfaces / PInterface Translator / PInterfaces / FixMath.p < prev    next >
Encoding:
Text File  |  1993-09-16  |  1.7 KB  |  86 lines  |  [TEXT/MPS ]

  1. {
  2. Created: Thursday, March 15, 1990 at 8:43 AM
  3.     FixMath.p
  4.     Pascal Interface to Fixed Point Math
  5.  
  6.     Copyright Apple Computer, Inc.    1985-1990
  7.     All rights reserved
  8.     
  9. CHANGE LOG:
  10.     23 Oct 90  JPO    Changed functions Frac2X, Fix2X, X2Fix, and X2Frac
  11.                       to in-line trap calls for non-mc68881 mode
  12. }
  13.  
  14.  
  15. {$IFC UNDEFINED UsingIncludes}
  16. {$SETC UsingIncludes := 0}
  17. {$ENDC}
  18.  
  19. {$IFC NOT UsingIncludes}
  20.     UNIT FixMath;
  21.     INTERFACE
  22. {$ENDC}
  23.  
  24. {$IFC UNDEFINED UsingFixMath}
  25. {$SETC UsingFixMath := 1}
  26.  
  27. {$I+}
  28. {$SETC FixMathIncludes := UsingIncludes}
  29. {$SETC UsingIncludes := 1}
  30. {$IFC UNDEFINED UsingTypes}
  31. {$I $$Shell(PInterfaces)Types.p}
  32. {$ENDC}
  33. {$SETC UsingIncludes := FixMathIncludes}
  34.  
  35.  
  36. FUNCTION Fix2Frac(x: Fixed): Fract;
  37.     INLINE $A841;
  38. FUNCTION Fix2Long(x: Fixed): LONGINT;
  39.     INLINE $A840;
  40. FUNCTION FixATan2(x: LONGINT;y: LONGINT): Fixed;
  41.     INLINE $A818;
  42. FUNCTION Long2Fix(x: LONGINT): Fixed;
  43.     INLINE $A83F;
  44. FUNCTION Frac2Fix(x: Fract): Fixed;
  45.     INLINE $A842;
  46.     
  47. {$IFC OPTION(MC68881)}
  48.  
  49. FUNCTION Frac2X(x: Fract): Extended;
  50. FUNCTION Fix2X(x: Fixed): Extended;
  51. FUNCTION X2Fix(x: Extended): Fixed;
  52. FUNCTION X2Frac(x: Extended): Fract;
  53.  
  54. {$ELSEC}
  55.  
  56. FUNCTION Frac2X(x: Fract): Extended;
  57.     INLINE $A845;
  58. FUNCTION Fix2X(x: Fixed): Extended;
  59.     INLINE $A843;
  60. FUNCTION X2Fix(x: Extended): Fixed;
  61.     INLINE $A844;
  62. FUNCTION X2Frac(x: Extended): Fract;
  63.     INLINE $A846;
  64.  
  65. {$ENDC}
  66.  
  67. FUNCTION FracMul(x: Fract;y: Fract): Fract;
  68.     INLINE $A84A;
  69. FUNCTION FixDiv(x: Fixed;y: Fixed): Fixed;
  70.     INLINE $A84D;
  71. FUNCTION FracDiv(x: Fract;y: Fract): Fract;
  72.     INLINE $A84B;
  73. FUNCTION FracSqrt(x: Fract): Fract;
  74.     INLINE $A849;
  75. FUNCTION FracSin(x: Fixed): Fract;
  76.     INLINE $A848;
  77. FUNCTION FracCos(x: Fixed): Fract;
  78.     INLINE $A847;
  79.  
  80. {$ENDC}    { UsingFixMath }
  81.  
  82. {$IFC NOT UsingIncludes}
  83.     END.
  84. {$ENDC}
  85.  
  86.